<!DOCTYPE html>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>

<!--
<div id='header'>

	<a href='Home.html'>
	<img style='display:inline-block;vertical-align:middle;' src='img/monkey32.png' /><b> Monkey V60 Documentation </b>
	</a>
	
	&nbsp;&nbsp;|&nbsp;&nbsp; <a class='small' href='Module list.html'>Modules</a>
	
	&nbsp;&nbsp;|&nbsp;&nbsp; <a class='small' href='Class index.html'>Classes</a>
	
	&nbsp;&nbsp;|&nbsp;&nbsp; <a class='small' href='Function index.html'>Functions</a>
	
	&nbsp;&nbsp;|&nbsp;&nbsp; <a class='small' href='Language reference.html'>Language</a>
	
	&nbsp;&nbsp;|&nbsp;&nbsp; <a class='small' href='Index.html'>Index</a>

</div>
-->

<div id='page'>
	<div id='main'>
		
		
		
		<div id='navpath'>
		
		
		<a href='abu.html'>abu</a>  /  <a href='abu.abuanimation.html'>abuanimation</a>  /  ISprite</div>

		<div id='content'>
			<div class='box'>
<h1>Interface ISprite</h1>The ISprite interface describes the behavior of entities that animate.

<a href='#long_desc'>More...</a>
			</div>
			
			
			
			<div class='box'>
				<h2>Properties</h2>
				<table class='small'><tr><td><a href='#CurrentAnimation'>CurrentAnimation</a> : String</td></tr><tr><td><a href='#NextAnimation'>NextAnimation</a> : String</td></tr><tr><td><a href='#LoopCount'>LoopCount</a> : Int</td></tr><tr><td><a href='#HandleX'>HandleX</a> : Int </td></tr><tr><td><a href='#HandleY'>HandleY</a> : Int </td></tr><tr><td><a href='#AnimationSheet'>AnimationSheet</a> : <a href="abu.abuimage.AbuAnimationSheet.html">AbuAnimationSheet</a></td></tr>				</table>
			</div>
			
			
			
			<div class='box'>
				<h2>Methods</h2>
				<table class='small'><tr><td><a href='#SetHandle'>SetHandle</a> : Void ( x:Int, y:Int )</td></tr><tr><td><a href='#SetAnimationSheet'>SetAnimationSheet</a> : Void ( path:String, frameWidth:Int, frameHeight:Int )</td></tr><tr><td><a href='#SetRate'>SetRate</a> : Void ( rate:Float )</td></tr><tr><td><a href='#AddAnimation'>AddAnimation</a> : Void ( name:String,{ start:Int,} sequence:Int[], frameDuration:Int{[]}, loop:Bool = True, flipX:Bool = False, flipY:Bool = False )</td></tr><tr><td><a href='#AddAnimation'>AddAnimation</a> : Void ( name:String, subAnimations:String[], loop:Bool = True, flipX:Bool = False, flipY:Bool = False )</td></tr><tr><td><a href='#PlayAnimation'>PlayAnimation</a> : Void ( name:String, reset:Bool = True, rate:Float = 1 )</td></tr><tr><td><a href='#QueueAnimation'>QueueAnimation</a> : Void ( name:String, reset:Bool = True, rate:Float = 1 )</td></tr><tr><td><a href='#OnAnimationLoop'>OnAnimationLoop</a> : Void ( animation:String )</td></tr><tr><td><a href='#OnAnimationEnd'>OnAnimationEnd</a> : Void ( animation:String )</td></tr><tr><td><a href='#AddOffset'>AddOffset</a> : Void ( name:String, offsetX:Int[], offsetY:Int[], cumulative:Bool = False )</td></tr><tr><td><a href='#AddDisplacement'>AddDisplacement</a> : Void ( name:String, displaceX:Int[], displaceY:Int[], cumulative:Bool = False )</td></tr><tr><td><a href='#Draw'>Draw</a> : Void ( x:Int, y:Int, rotation:Float = 0, scaleX:Float = 1, scaleY:Float = 1 )</td></tr>				</table>
			</div>
			
			
			
			<a name='long_desc'></a>
			<div class='box'>
				<h2>Detailed Discussion</h2>The ISprite interface describes the behavior of entities that animate.
<p>
It is implemented by the <a href='abu.abuanimation.AbuSprite.html'>AbuSprite</a> and <a href='abu.abuentity.abuspritecomponent.SpriteComponent.html'>SpriteComponent</a> classes.

</div>
			
			
			
			<div class='box'>
				<h2>Property Documentation</h2>		<a name='CurrentAnimation'></a>
				<div class='box'>
<h3 class='rounded'>Property CurrentAnimation : String</h3>
[read-only] The name of the animation that is currently playing.


<p><b>See also</b> <a href='#PlayAnimation'>PlayAnimation</a>				</div>
			
			
			
			<a name='NextAnimation'></a>
				<div class='box'>
<h3 class='rounded'>Property NextAnimation : String</h3>
[read-only] The name of the animation that is qeued to play next, if any.


<p><b>See also</b> <a href='#QeueAnimation'>QeueAnimation</a>				</div>
			
			
			
			<a name='LoopCount'></a>
				<div class='box'>
<h3 class='rounded'>Property LoopCount : Int</h3>
[read-only] Returns amount of times the current animation has looped.

				</div>
			
			
			
			<a name='HandleX'></a>
				<div class='box'>
<h3 class='rounded'>Property HandleX : Int </h3>
[read-only] The x coordinate of the sprite's handle


<p><b>See also</b> <a href='#HandleY'>HandleY</a>, <a href='#SetHandle'>SetHandle</a>				</div>
			
			
			
			<a name='HandleY'></a>
				<div class='box'>
<h3 class='rounded'>Property HandleY : Int </h3>
[read-only] The y coordinate of the sprite's handle


<p><b>See also</b> <a href='#HandleX'>HandleX</a>, <a href='#SetHandle'>SetHandle</a>				</div>
			
			
			
			<a name='AnimationSheet'></a>
				<div class='box'>
<h3 class='rounded'>Property AnimationSheet : <a href="abu.abuimage.AbuAnimationSheet.html">AbuAnimationSheet</a></h3>
The animation sheet assigned to the sprite.


<p><b>See also</b> <a href='#SetAnimationSheet'>SetAnimationSheet</a>				</div>
			
			
			
			</div>
		<div class='box'>
				<h2>Method Documentation</h2>		<a name='SetHandle'></a>
				<div class='box'>
<h3 class='rounded'>Method SetHandle : Void ( x:Int, y:Int )</h3>
Sets the handle for this animation. Defaults to 0,0.


<p><b>See also</b> <a href='#HandleX'>HandleX</a>, <a href='#HandleY'>HandleY</a>				</div>
			
			
			
			<a name='SetAnimationSheet'></a>
				<div class='box'>
<h3 class='rounded'>Method SetAnimationSheet : Void ( path:String, frameWidth:Int, frameHeight:Int )</h3>
Assigns the sprite's animation sheet.
<p>
The path can be in one of the following forms:
<p>
<li>"directory/my_image.png" - loads from an image file.<br></li>
<li>"directory/my_atlas.png#sub_texture" - loads from a texture atlas. The extension is optional.<br></li>


<p><b>See also</b> <a href='#AnimationSheet'>AnimationSheet</a>				</div>
			
			
			
			<a name='SetRate'></a>
				<div class='box'>
<h3 class='rounded'>Method SetRate : Void ( rate:Float )</h3>
Sets the global playback rate for the sprite. Affects animations currently playing.

				</div>
			
			
			
			<a name='AddAnimation'></a>
				<div class='box'>
<h3 class='rounded'>Method AddAnimation : Void ( name:String,{ start:Int,} sequence:Int[], frameDuration:Int{[]}, loop:Bool = True, flipX:Bool = False, flipY:Bool = False )</h3>
Creates and attaches a new animation to the sprite.
<p>Takes an optional <i>start</i> parameter that defines the frame index that counting should start from.
<p>The <i>frameDuration</i> parameter can be either a single value, or an array of values corresponding to each frame in the sequence.


<p><b>See also</b> <a href='#PlayAnimation'>PlayAnimation</a>, <a href='#QeueAnimation'>QeueAnimation</a>				</div>
			
			
			
			<a name='AddAnimation'></a>
				<div class='box'>
<h3 class='rounded'>Method AddAnimation : Void ( name:String, subAnimations:String[], loop:Bool = True, flipX:Bool = False, flipY:Bool = False )</h3>
Creates and attaches a new compound animation to the sprite.


<p><b>See also</b> <a href='#PlayAnimation'>PlayAnimation</a>, <a href='#QeueAnimation'>QeueAnimation</a>				</div>
			
			
			
			<a name='PlayAnimation'></a>
				<div class='box'>
<h3 class='rounded'>Method PlayAnimation : Void ( name:String, reset:Bool = True, rate:Float = 1 )</h3>
Plays the specified animation.
<p>
Optionally <i>reset</i> can be False to allow animations to pick up where they left off.
<p>
Also takes an optional playback <i>rate</i> parameter.


<p><b>See also</b> <a href='#CurrentAnimation'>CurrentAnimation</a>, <a href='#AddAnimation'>AddAnimation</a>, <a href='#QeueAnimation'>QeueAnimation</a>				</div>
			
			
			
			<a name='QueueAnimation'></a>
				<div class='box'>
<h3 class='rounded'>Method QueueAnimation : Void ( name:String, reset:Bool = True, rate:Float = 1 )</h3>
Queues the specified animation to be played after the current one ends or finishes a loop.
<p>
Optionally <i>reset</i> can be False to allow animations to pick up where they left off.
<p>
Also takes an optional playback <i>rate</i> parameter.


<p><b>See also</b> <a href='#NextAnimation'>NextAnimation</a>, <a href='#AddAnimation'>AddAnimation</a>, <a href='#PlayAnimation'>PlayAnimation</a>				</div>
			
			
			
			<a name='OnAnimationLoop'></a>
				<div class='box'>
<h3 class='rounded'>Method OnAnimationLoop : Void ( animation:String )</h3>
Intended to be overridden.

				</div>
			
			
			
			<a name='OnAnimationEnd'></a>
				<div class='box'>
<h3 class='rounded'>Method OnAnimationEnd : Void ( animation:String )</h3>
Intended to be overridden.

				</div>
			
			
			
			<a name='AddOffset'></a>
				<div class='box'>
<h3 class='rounded'>Method AddOffset : Void ( name:String, offsetX:Int[], offsetY:Int[], cumulative:Bool = False )</h3>
Allows animations to adjust the handle as they play.

				</div>
			
			
			
			<a name='AddDisplacement'></a>
				<div class='box'>
<h3 class='rounded'>Method AddDisplacement : Void ( name:String, displaceX:Int[], displaceY:Int[], cumulative:Bool = False )</h3>
Only functions when the sprite is a component of an entity.

				</div>
			
			
			
			<a name='Draw'></a>
				<div class='box'>
<h3 class='rounded'>Method Draw : Void ( x:Int, y:Int, rotation:Float = 0, scaleX:Float = 1, scaleY:Float = 1 )</h3>
Draws the sprite at coordinates x, y, offset by the sprite's handle and the current animation's offset values, if any.

				</div>
			
			
			
			</div>
		


			<br><br><br><br><br><br><br><br><br><br>
			<br><br><br><br><br><br><br><br><br><br>
			<br><br><br><br><br><br><br><br><br><br>
			<br><br><br><br><br><br><br><br><br><br>			
		</div>
	</div>
	
	<div id='footer'>

	</div>
</div> 

</body>
</html>